# 导包
import unittest
import app
from api.order import OrderAPI
import utils
from parameterized import parameterized


# 创建测试类
class TestOrderAPI(unittest.TestCase):

    # 初始化
    order_id = None

    # 前置处理
    def setUp(self) -> None:
        self.order_api = OrderAPI()

    # 后置处理
    def tearDown(self) -> None:
        pass

    # 创建订单
    @parameterized.expand(utils.read_file())
    def test01_cate_order(self, insert_data, status_code, pass1):
        response = self.order_api.cate_order(insert_data)
        print(response.json())
        # 断言
        self.assertEqual(status_code, response.status_code)
        self.assertEqual(pass1, response.json().get("pass"))







































































